1 -- this (function) script uses as thank capacity a value stored in GVAR9 for fase 9
2 -- the value in GVAR9 is the number of 50 ml in the thank.
3 -- It means e.g. that for a thank of 1000 ml, GVAR9 must be set to 20 (=1000 / 50 )
17 local timenow
= getTime() -- 10ms tick count
19 if timenow
- timeprev
> 50 then-- more than 500 msec since previous run
21 local tankcapacity
= 50 * model
.getGlobalVariable(8, 8) -- get value of gvar 9 for flight mode 9
22 if tankcapacity
< 100 then
25 if tankcapacity
> 3000 then
28 local ret
= sportTelemetryPush( 0x0D , 0X10 , 8, tankcapacity
)
32 return { init
=init
, run
=run
}